# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=cfssl
pkgver=1.6.1
pkgrel=6
pkgdesc="Cloudflare PKI and TLS toolkit"
url="https://cfssl.org/"
license="BSD-2-Clause"
arch="all !riscv64" # FTBFS
options="!check" # TODO: fix and enable tests
makedepends="go"
source="https://github.com/cloudflare/cfssl/archive/v$pkgver/cfssl-$pkgver.tar.gz"

export GOPATH="$srcdir"
export GOFLAGS="$GOFLAGS -trimpath -modcacherw -mod=vendor"

build() {
	go build \
		-ldflags="-s -w -X github.com/cloudflare/cfssl/cli/version.version=$pkgver" \
		-v -o bin/ ./cmd/...
}

check() {
	go test ./...
}

package() {
	install -Dm755 -t "$pkgdir"/usr/bin bin/*
}

sha512sums="
50b117364e32f9a1377e3760c9466deb9ac64efdaef77ce122b3f08245ef82b8403d8ebb03398069b8d1513916c84da3ec8f914fdb324eb2e15d235aabfebdb8  cfssl-1.6.1.tar.gz
"
